@echo off

set TARGET=build\cxfreeze

echo ### Preparing virtualenv...
call venv\Scripts\activate.bat
echo ### Preparing virtualenv... Done

::echo ### Installing pyinstaller...
::pip install pyinstaller > nul 2>&1
::pip install pypiwin32 > nul 2>&1
::echo ### Installing pyinstaller... Done

echo ### Installing packages...
pip install chardet > nul 2>&1
echo ### Installing packages... Done

echo ### Building exe...
cxfreeze Main.pyw --base-name=win32gui --target-dir %TARGET%
echo ### Building exe... Done

echo ### Copying misc...
xcopy bin\* %TARGET%\bin\ /S /E /Y
echo ### Copying misc... Done

echo ### Leaving virtualenv...
cd venv\Scripts
call deactivate.bat
cd ..\..
echo ### Leaving virtualenv... Done
